package util;

import java.io.IOException;
import java.util.Properties;

import javax.swing.ImageIcon;

import view.MainWindow;

public class UtilClass {

	private static Properties properties;

	public UtilClass() {
		properties = new Properties();
		try {
			properties.load(this.getClass().getClassLoader()
					.getResourceAsStream("project.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static Properties getProjectProperties() {
		return properties;
	}

	public static ImageIcon createImageIcon(String path) {
		java.net.URL imgURL = MainWindow.class.getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL);
		} else {
			System.err.println("Couldn't find file: " + path);
			return null;
		}
	}

}